import React, { Component } from "react";

export default class App extends Component {
  state = {
    todoList: ["吃饭"],
  };
  printTitle() {
    if (this.state.todoList.length === 0) {
      return <p>您当前暂无代办事项</p>;
    } else {
      return <span>您当前有{this.state.todoList.length}条待办事项</span>;
    }
  }
  render() {
    return <div>{this.printTitle()}</div>;
  }
}
